package project.bank.views;

import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JTable;

import project.bank.contoller.ControllerAddPAcc;
import project.bank.framwork.BaseForm;


public class BtnAddPerson extends JButton implements ICommandBtn {
	public BaseForm context;
	ControllerAddPAcc controllerAddPAcc;

	public BtnAddPerson(BankFrm context, ActionListener listener) {
		addActionListener(listener);
		this.context = context;

		controllerAddPAcc = new ControllerAddPAcc(context);
		JDialog_AddPAcc pac = new JDialog_AddPAcc(context, controllerAddPAcc);
		pac.setBounds(450, 20, 300, 330);
		controllerAddPAcc.setDialog(pac);
	}

	@Override
	public void execute() {
		// get selected account
		JTable table = context.getTable();
		controllerAddPAcc.showDialog();
	}

}
